﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ChatBox.Utilities;

namespace ChatBox.Models
{
  public class ChannelInfo : MessageRepository
  {
    #region Constructors

    public ChannelInfo()
      : base()
    {
    }

    #endregion

    #region Public Properties

    public ServerInfo Server
    {
      get
      {
        return _server;
      }
      set
      {
        if ( value != _server )
        {
          _server = value;

          this.OnPropertyChanged( "Server" );
        }
      }
    }

    public ViewableCollection<UserInfo> Users
    {
      get
      {
        return _users;
      }
    }

    public ChannelStatus Status
    {
      get
      {
        return _status;
      }
      set
      {
        if ( value != _status )
        {
          _status = value;

          this.OnPropertyChanged( "Status" );
        }
      }
    }

    #endregion

    #region Private Variables

    private ServerInfo _server = null;

    private readonly ViewableCollection<UserInfo> _users = new ViewableCollection<UserInfo>();

    private ChannelStatus _status = ChannelStatus.Idle;

    #endregion
  }
}
